import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'

dayjs.extend(utc)

const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
export function formatUtcString(
  data: string,
  formatString: string = DATE_TIME_FORMAT
): string {
  return dayjs.utc(data).utcOffset(8).format(formatString)
}
